package ltd.dujiabao.eduservice.controller;

import io.swagger.annotations.Api;
import ltd.dujiabao.commonutils.Result;
import org.springframework.web.bind.annotation.*;

/**
 * @author : DuJiabao
 * @Project : online-course-project
 * @Time : 2021/4/20 9:45
 * @Desc :
 */

@Api(value = "后台登录")
@RestController
@RequestMapping("/eduservice/login")
@CrossOrigin
public class EduLoginController {
  @PostMapping("/login")
  public Result Login(String username, String password) {
    return Result.success().addData("token", "admin");
  }

  @GetMapping("/info")
  public Result Info(String token) {
    return Result.success().addData("name", "admin").addData("roles", "[admin]").addData("avatar", "https://online-course-project-avatar.oss-cn-shenzhen.aliyuncs.com/%E5%B8%8C%E6%9E%973.jpg");
  }
}
